home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 July: Mac OS SDK / Dev.CD Jul 97 SDK1.toast / Development Kits (Disc 1) / PC Card Manager / CIncludes / CodeFragments.h next >
Encoding:
C/C++ Source or Header  |  1997-01-13  |  20.3 KB  |  601 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        CodeFragments.h
  3.  
  4.      Contains:    Public Code Fragment Manager Interfaces.
  5.  
  6.      Version:    System 7 and System 8
  7.  
  8.      DRI:        Alan Lillich
  9.  
  10.      Copyright:    © 1984-1996 by Apple Computer, Inc.
  11.                  All rights reserved.
  12.  
  13.      Warning:    *** APPLE INTERNAL USE ONLY ***
  14.                  This file may contain unreleased API's
  15.  
  16.      BuildInfo:    Built by:            SuperMario Build Daemon
  17.                  With Interfacer:    2.0d11   (PowerPC native)
  18.                  From:                CodeFragments.i
  19.                      Revision:        54
  20.                      Dated:            3/4/96
  21.                      Last change by:    AWL
  22.                      Last comment:    Move infoVersion parameter in CFragGetRegisteredFiles.
  23.  
  24.      Bugs:        Report bugs to Radar component “System Interfaces”, “Latest”
  25.                  List the version information (from above) in the Problem Description.
  26.  
  27. */
  28. /*
  29.  •
  30.  ===========================================================================================
  31.  The Code Fragment Manager API
  32.  =============================
  33. */
  34. #ifndef __CODEFRAGMENTS__
  35. #define __CODEFRAGMENTS__
  36.  
  37. #ifndef __TYPES__
  38. #include <Types.h>
  39. #endif
  40. #ifndef __FILES__
  41. #include <Files.h>
  42. #endif
  43. #if FOR_SYSTEM8_PREEMPTIVE
  44. #ifndef __KERNEL__
  45. #include <Kernel.h>
  46. #endif
  47. #ifndef __FILEMANAGERTYPES__
  48. #include <FileManagerTypes.h>
  49. #endif
  50. #ifndef __TEXTOBJECTS__
  51. #include <TextObjects.h>
  52. #endif
  53. #endif
  54.  
  55. #ifdef __cplusplus
  56. extern "C" {
  57. #endif
  58.  
  59. #if PRAGMA_IMPORT_SUPPORTED
  60. #pragma import on
  61. #endif
  62.  
  63. #if PRAGMA_ALIGN_SUPPORTED
  64. #pragma options align=mac68k
  65. #endif
  66.  
  67. /*
  68.  §
  69.  ===========================================================================================
  70.  Universal types and constants
  71.  =============================
  72. */
  73. #if FOR_SYSTEM7_AND_SYSTEM8_PREEMPTIVE
  74. /*
  75.  ----------------------------------------------------------------------------
  76.  These declarations are for System 7 and all System 8 execution environments.
  77. */
  78.  
  79. enum {
  80.     kCFragResourceType            = 'cfrg',
  81.     kCFragResourceID            = 0,
  82.     kCFragLibraryFileType        = 'shlb',
  83.     kCFragAllFileTypes            = 0xFFFFFFFF
  84. };
  85.  
  86. typedef OSType CFragArchitecture;
  87.  
  88. enum {
  89.     kPowerPCCFragArch            = 'pwpc',
  90.     kMotorola68KCFragArch        = 'm68k',
  91.     kAnyCFragArch                = 0x3F3F3F3F
  92. };
  93.  
  94. #if GENERATINGPOWERPC
  95.  
  96. enum {
  97.     kCompiledCFragArch            = kPowerPCCFragArch
  98. };
  99.  
  100. #endif
  101. #if GENERATING68K
  102.  
  103. enum {
  104.     kCompiledCFragArch            = kMotorola68KCFragArch
  105. };
  106.  
  107. #endif
  108. typedef UInt32 CFragVersionNumber;
  109.  
  110. enum {
  111.     kNullCFragVersion            = 0,
  112.     kWildcardCFragVersion        = 0xFFFFFFFF
  113. };
  114.  
  115. typedef UInt8 CFragUsage;
  116.  
  117. enum {
  118.     kImportLibraryCFrag            = 0,                            /* Standard CFM import library.*/
  119.     kApplicationCFrag            = 1,                            /* Macintosh application.*/
  120.     kDropInAdditionCFrag        = 2                                /* Private extension to an application or library.*/
  121. };
  122.  
  123.  
  124. enum {
  125.     kIsCompleteCFrag            = 0,                            /* A "base" fragment, not an update.*/
  126.     kFirstCFragUpdate            = 1                                /* The first update, others are numbered 2, 3, ...*/
  127. };
  128.  
  129.  
  130. enum {
  131.     kCFragGoesToEOF                = 0
  132. };
  133.  
  134. typedef UInt8 CFragLocatorKind;
  135.  
  136. enum {
  137.     kMemoryCFragLocator            = 0,                            /* Container is already addressable.*/
  138.     kDataForkCFragLocator        = 1,                            /* Container is in a file's data fork.*/
  139.     kResourceCFragLocator        = 2                                /* Container is in a file's resource fork.*/
  140. };
  141.  
  142. /*
  143.  --------------------------------------------------------------------------------------
  144.  A 'cfrg' resource consists of a header followed by a sequence of variable length
  145.  members.  The constant kDefaultCFragNameLen only provides for a legal ANSI declaration
  146.  and for a reasonable display in a debugger.  The actual name field is cut to fit.
  147.  There may be "extensions" after the name, the memberSize field includes them.  The
  148.  general form of an extension is a 16 bit type code followed by a 16 bit size in bytes.
  149.  Only one standard extension type is defined at present, it is used by SOM's searching
  150.  mechanism.
  151. */
  152. union CFragUsage1Union {                                                                /* ! Meaning differs depending on value of "usage".*/
  153.     UInt32                             appStackSize;                /* If the fragment is an application. (Not used by CFM!)*/
  154. };
  155. typedef union CFragUsage1Union CFragUsage1Union;
  156.  
  157. union CFragUsage2Union {                                                                /* ! Meaning differs depending on value of "usage".*/
  158.     SInt16                             appSubdirID;                /* If the fragment is an application.*/
  159. };
  160. typedef union CFragUsage2Union CFragUsage2Union;
  161.  
  162. union CFragWhere1Union {                                                                /* ! Meaning differs depending on value of "where".*/
  163.     UInt32                             spaceID;                    /* If the fragment is in memory.  (Actually an AddressSpaceID.)*/
  164.     OSType                             forkKind;                    /* If the fragment is in an arbitrary byte stream fork.*/
  165. };
  166. typedef union CFragWhere1Union CFragWhere1Union;
  167.  
  168. union CFragWhere2Union {                                                                /* ! Meaning differs depending on value of "where".*/
  169.     UInt16                             forkInstance;                /* If the fragment is in an arbitrary byte stream fork.*/
  170. };
  171. typedef union CFragWhere2Union CFragWhere2Union;
  172.  
  173.  
  174. enum {
  175.     kDefaultCFragNameLen        = 16
  176. };
  177.  
  178. struct CFragResourceMember {
  179.     CFragArchitecture                 architecture;
  180.     UInt16                             reservedA;                    /* ! Must be zero!*/
  181.     UInt8                             reservedB;                    /* ! Must be zero!*/
  182.     UInt8                             updateLevel;
  183.     CFragVersionNumber                 currentVersion;
  184.     CFragVersionNumber                 oldDefVersion;
  185.     CFragUsage1Union                 uUsage1;
  186.     CFragUsage2Union                 uUsage2;
  187.     CFragUsage                         usage;
  188.     CFragLocatorKind                 where;
  189.     UInt32                             offset;
  190.     UInt32                             length;
  191.     CFragWhere1Union                 uWhere1;
  192.     CFragWhere2Union                 uWhere2;
  193.     UInt16                             extensionCount;                /* The number of extensions beyond the name.*/
  194.     UInt16                             memberSize;                    /* Size in bytes, includes all extensions.*/
  195.     unsigned char                     name[16];                    /* ! Actually a sized PString.*/
  196. };
  197. typedef struct CFragResourceMember CFragResourceMember;
  198.  
  199. typedef CFragResourceMember *CFragResourceMemberPtr;
  200. struct CFragResourceExtensionHeader {
  201.     UInt16                             extensionKind;
  202.     UInt16                             extensionSize;
  203. };
  204. typedef struct CFragResourceExtensionHeader CFragResourceExtensionHeader;
  205.  
  206. typedef CFragResourceExtensionHeader *CFragResourceExtensionHeaderPtr;
  207. struct CFragResourceSearchExtension {
  208.     CFragResourceExtensionHeader     header;
  209.     OSType                             libKind;
  210.     unsigned char                     qualifiers[1];                /* ! Actually four PStrings.*/
  211. };
  212. typedef struct CFragResourceSearchExtension CFragResourceSearchExtension;
  213.  
  214. typedef CFragResourceSearchExtension *CFragResourceSearchExtensionPtr;
  215.  
  216. enum {
  217.     kCFragResourceSearchExtensionKind = 0x30EE
  218. };
  219.  
  220. struct CFragResource {
  221.     UInt32                             reservedA;                    /* ! Must be zero!*/
  222.     UInt32                             reservedB;                    /* ! Must be zero!*/
  223.     UInt16                             reservedC;                    /* ! Must be zero!*/
  224.     UInt16                             version;
  225.     UInt32                             reservedD;                    /* ! Must be zero!*/
  226.     UInt32                             reservedE;                    /* ! Must be zero!*/
  227.     UInt32                             reservedF;                    /* ! Must be zero!*/
  228.     UInt32                             reservedG;                    /* ! Must be zero!*/
  229.     UInt16                             reservedH;                    /* ! Must be zero!*/
  230.     UInt16                             memberCount;
  231.     CFragResourceMember             firstMember;
  232. };
  233. typedef struct CFragResource CFragResource;
  234.  
  235. typedef CFragResource *CFragResourcePtr;
  236.  
  237. enum {
  238.     kCurrCFragResourceVersion    = 1
  239. };
  240.  
  241. #define AlignToFour(aValue)    (((aValue) + 3) & ~3)
  242. #define kBaseCFragResourceMemberSize    (offsetof ( CFragResourceMember, name ) )
  243. #define kBaseCFragResourceSize            (offsetof ( CFragResource, firstMember.name ) )
  244. #define NextCFragResourceMemberPtr(aMemberPtr)    \
  245.         ((CFragResourceMemberPtr) ((BytePtr)aMemberPtr + aMemberPtr->memberSize))
  246. #define FirstCFragResourceExtensionPtr(aMemberPtr)                                            \
  247.         ((CFragResourceExtensionHeaderPtr) ((BytePtr)aMemberPtr +                            \
  248.                                             AlignToFour ( kBaseCFragResourceMemberSize +    \
  249.                                                           aMemberPtr->name[0] + 1 ) ))
  250. #define NextCFragResourceExtensionPtr(anExtensionPtr)                    \
  251.         ((CFragResourceExtensionHeaderPtr) ((BytePtr)anExtensionPtr +    \
  252.                                             ((CFragResourceExtensionHeaderPtr)anExtensionPtr)->extensionSize ))
  253. #define FirstCFragResourceSearchQualifier(searchExtensionPtr)                    \
  254.         ((StringPtr) ((BytePtr)searchExtensionPtr +                                \
  255.                       offsetof ( CFragResourceSearchExtension, qualifiers ) ))
  256. #define NextCFragResourceSearchQualifier(searchQualifierPtr)    \
  257.         ((StringPtr) ((BytePtr)searchQualifierPtr +    searchQualifierPtr[0] + 1))
  258. typedef struct OpaqueCFragConnectionID* CFragConnectionID;
  259. typedef struct OpaqueCFragClosureID* CFragClosureID;
  260. typedef struct OpaqueCFragContainerID* CFragContainerID;
  261. typedef struct OpaqueCFragContextID* CFragContextID;
  262. typedef UInt32 CFragLoadOptions;
  263.  
  264. enum {
  265.     kLoadCFrag                    = 0x0001,                        /* Try to use existing copy, load if not found.*/
  266.     kFindCFrag                    = 0x0002,                        /* Try find an existing copy, don't load if not found.*/
  267.     kPrivateCFragCopy            = kLoadCFrag | 0x0004            /* Load a new private copy.*/
  268. };
  269.  
  270.  
  271. enum {
  272.     kUnresolvedCFragSymbolAddress = 0
  273. };
  274.  
  275. typedef UInt8 CFragSymbolClass;
  276.  
  277. enum {
  278.     kCodeCFragSymbol            = 0,
  279.     kDataCFragSymbol            = 1,
  280.     kTVectorCFragSymbol            = 2,
  281.     kTOCCFragSymbol                = 3,
  282.     kGlueCFragSymbol            = 4
  283. };
  284.  
  285. #endif
  286. /*
  287.  §
  288.  ===========================================================================================
  289.  System 7 Services (Deprecated in System 8)
  290.  ==========================================
  291. */
  292. #if FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED
  293. /*
  294.  ---------------------------------------------------------------------------------
  295.  These declarations are for System 7 and the System 8 cooperative environment, but
  296.  should be avoided under System 8.  Better alternatives exist for System 8.
  297. */
  298. #define IsFileLocation(where)    \
  299.         ( ((where) == kDataForkCFragLocator) || ((where) == kResourceCFragLocator) )
  300. extern pascal OSErr GetSharedLibrary(ConstStr63Param libName, CFragArchitecture archType, CFragLoadOptions loadFlags, CFragConnectionID *connID, Ptr *mainAddr, Str255 errMessage)
  301.  THREEWORDINLINE(0x3F3C, 0x0001, 0xAA5A);
  302.  
  303. extern pascal OSErr GetDiskFragment(const FSSpec *fileSpec, UInt32 offset, UInt32 length, ConstStr63Param fragName, CFragLoadOptions loadFlags, CFragConnectionID *connID, Ptr *mainAddr, Str255 errMessage)
  304.  THREEWORDINLINE(0x3F3C, 0x0002, 0xAA5A);
  305.  
  306. extern pascal OSErr GetMemFragment(void *memAddr, UInt32 length, ConstStr63Param fragName, CFragLoadOptions loadFlags, CFragConnectionID *connID, Ptr *mainAddr, Str255 errMessage)
  307.  THREEWORDINLINE(0x3F3C, 0x0003, 0xAA5A);
  308.  
  309. extern pascal OSErr CloseConnection(CFragConnectionID *connID)
  310.  THREEWORDINLINE(0x3F3C, 0x0004, 0xAA5A);
  311.  
  312. extern pascal OSErr FindSymbol(CFragConnectionID connID, ConstStr255Param symName, Ptr *symAddr, CFragSymbolClass *symClass)
  313.  THREEWORDINLINE(0x3F3C, 0x0005, 0xAA5A);
  314.  
  315. extern pascal OSErr CountSymbols(CFragConnectionID connID, long *symCount)
  316.  THREEWORDINLINE(0x3F3C, 0x0006, 0xAA5A);
  317.  
  318. extern pascal OSErr GetIndSymbol(CFragConnectionID connID, long symIndex, Str255 symName, Ptr *symAddr, CFragSymbolClass *symClass)
  319.  THREEWORDINLINE(0x3F3C, 0x0007, 0xAA5A);
  320.  
  321. #endif
  322. /*
  323.  §
  324.  ===========================================================================================
  325.  System 8 Services (Not available in System 7)
  326.  =============================================
  327. */
  328. #if FOR_SYSTEM8_PREEMPTIVE
  329. /*
  330.  ---------------------------------------------------------------------------------
  331.  These declarations are for all System 8 execution environments, but not System 7.
  332. */
  333.  
  334. enum {
  335.     kPatchCFragUpdateLevel        = 255
  336. };
  337.  
  338.  
  339. enum {
  340.     kByteStreamCFragLocator        = 3,
  341.     kNamedFragmentCFragLocator    = 4
  342. };
  343.  
  344.  
  345. enum {
  346.     kNamedLibraryCFragLocator    = kNamedFragmentCFragLocator    /* !!! Remove in D12!*/
  347. };
  348.  
  349.  
  350. enum {
  351.     kPrivilegedCFragMask        = 0x0010,                        /* ! May be removed in the future!*/
  352.     kResidentCFragMask            = 0x0020,                        /* ! May be removed in the future!*/
  353.     kTreatCFragAsLibraryMask    = 0x0040                        /* Used in GetXyzFragment to recognize by name too.*/
  354. };
  355.  
  356.  
  357. enum {
  358.     kPrivilegedCFragFlag        = kPrivilegedCFragMask,            /* !!! Remove in D12!*/
  359.     kResidentCFragFlag            = kResidentCFragMask            /* !!! Remove in D12!*/
  360. };
  361.  
  362.  
  363. enum {
  364.     kMainCFragSymbolIndex        = -1,
  365.     kInitCFragSymbolIndex        = -2,
  366.     kTermCFragSymbolIndex        = -3
  367. };
  368.  
  369. struct CFragRegisteredFileInfo {
  370.     FSObjectRef                     fileRef;
  371.     OSType                             fileType;
  372.     ItemCount                         nestingDepth;
  373. };
  374. typedef struct CFragRegisteredFileInfo CFragRegisteredFileInfo;
  375.  
  376.  
  377. enum {
  378.     kCFragRegisteredFileInfoVersion = 0x00010001
  379. };
  380.  
  381. typedef UInt8 CFragCompatibility;
  382.  
  383. enum {
  384.     CFragBothCompatible            = 0,
  385.     CFragClientTooOld            = 1,
  386.     CFragProviderTooOld            = 2
  387. };
  388.  
  389. typedef UInt32 CFragShortVersionPair;
  390. #define ComposeCFragShortVersionPair(current,older)    (current << 16 | older)
  391. #define GetCFragShortVersionCurrent(version)        (version >> 16)
  392. #define GetCFragShortVersionOlder(version)            (version & 0xFFFF)
  393. extern CFragCompatibility CFragCheckCompatibility(UInt32 clientPreferredVersion, UInt32 clientOldImpVersion, UInt32 providerCurrentVersion, UInt32 providerOldDefVersion);
  394.  
  395. extern CFragCompatibility CFragCheckShortCompatibility(UInt32 clientVersions, UInt32 providerVersions);
  396.  
  397. extern Boolean CFragHasFileLocation(CFragLocatorKind where);
  398.  
  399. extern Boolean CFragHasUnresolvedImports(CFragConnectionID connID);
  400.  
  401. extern OSStatus CFragPrepareNamedFragment(ConstStr63Param fragName, CFragUsage usage, CFragArchitecture archType, CFragVersionNumber preferredVersion, CFragVersionNumber oldestVersion, CFragLoadOptions loadFlags, CFragConnectionID *connID, LogicalAddress *mainAddr, TextObject optErrMsg);
  402.  
  403. extern OSStatus CFragPrepareFromDiskFork(FSObjectRef fileSpec, FSForkType forkTag, ItemCount forkInstance, ByteCount offset, ByteCount length, ConstStr63Param fragName, CFragLoadOptions loadFlags, CFragConnectionID *connID, LogicalAddress *mainAddr, TextObject optErrMsg);
  404.  
  405. extern OSStatus CFragPrepareFromMemory(LogicalAddress fragAddr, ByteCount length, ConstStr63Param fragName, CFragLoadOptions loadFlags, CFragConnectionID *connID, LogicalAddress *mainAddr, TextObject optErrMsg);
  406.  
  407. extern OSStatus CFragCloseConnection(CFragConnectionID *connID);
  408.  
  409. extern OSStatus CFragFindNamedSymbol(CFragConnectionID connID, ConstStr255Param symName, LogicalAddress *symAddr, CFragSymbolClass *symClass);
  410.  
  411. extern OSStatus CFragCountSymbols(CFragConnectionID connID, ItemCount *symCount);
  412.  
  413. extern OSStatus CFragGetIndexedSymbol(CFragConnectionID connID, SInt32 symIndex, Str255 symName, LogicalAddress *symAddr, CFragSymbolClass *symClass);
  414.  
  415. extern OSStatus CFragGetFileSpec(CFragConnectionID connectionID, FSObjectRef *fileSpec);
  416.  
  417. extern OSStatus CFragGetFragmentName(CFragConnectionID connectionID, Str63 name);
  418.  
  419. extern OSStatus CFragRegisterFileFragments(KernelProcessID processID, FSObjectRef fileSpec, OSType fileType, ItemCount nestingDepth);
  420.  
  421. extern OSStatus CFragUnregisterFileFragments(KernelProcessID processID, FSObjectRef fileSpec, OSType fileType, ItemCount nestingDepth);
  422.  
  423. extern OSStatus CFragGetRegisteredFiles(KernelProcessID processID, ItemCount requestedCount, ItemCount *totalCount, PBVersion infoVersion, CFragRegisteredFileInfo *registeredFiles);
  424.  
  425. #endif
  426. /*
  427.  §
  428.  ===========================================================================================
  429.  Initialization & Termination Routines
  430.  =====================================
  431.  -----------------------------------------------------------------------------------------
  432.  A fragment's initialization and termination routines are called when a new incarnation of
  433.  the fragment is created or destroyed, respectively.  Exactly when this occurs depends on
  434.  what kinds of section sharing the fragment has and how the fragment is prepared.  Import
  435.  libraries have at most one incarnation per process.  Fragments prepared with option
  436.  kPrivateCFragCopy may have many incarnations per process.
  437.  The initialization function is passed a pointer to an initialization information structure
  438.  and returns an OSErr.  If an initialization function returns a non-zero value the entire
  439.  closure of which it is a part fails.  The CFragInitBlock type has different visible parts
  440.  under System 7 and System 8, but is of course the same internally.  The C prototype for an
  441.  initialization function is:
  442.         pascal OSErr    CFragInitFunction    ( const CFragInitBlock *    initBlock );
  443.  The termination procedure takes no parameters and returns nothing.  The C prototype for a
  444.  termination procedure is:
  445.         pascal void        CFragTermProcedure    ( void );
  446. */
  447. #if FOR_OPAQUE_SYSTEM_DATA_STRUCTURES
  448. /*
  449.  --------------------------------------------------------------------------------------
  450.  These declarations are the preferred form for System 8, hiding implementation details.
  451. */
  452. struct CFragOpaqueInitBlock {
  453.     KernelProcessID                 processID;
  454.     CFragClosureID                     closureID;
  455.     CFragConnectionID                 connectionID;
  456.     UInt32                             reservedA[8];
  457. };
  458. typedef struct CFragOpaqueInitBlock CFragOpaqueInitBlock;
  459.  
  460. typedef CFragOpaqueInitBlock *CFragOpaqueInitBlockPtr;
  461. typedef CFragOpaqueInitBlock CFragInitBlock;
  462. typedef CFragOpaqueInitBlockPtr CFragInitBlockPtr;
  463. #else
  464. /*
  465.  --------------------------------------------------------------------------------------
  466.  These declarations are for System 7.  They may be used in System 8 but expose details.
  467. */
  468. struct CFragSystem7MemoryLocator {
  469.     LogicalAddress                     address;
  470.     UInt32                             length;
  471.     Boolean                         inPlace;
  472.     UInt8                             reservedA;                    /* ! Must be zero!*/
  473.     UInt16                             reservedB;                    /* ! Must be zero!*/
  474. };
  475. typedef struct CFragSystem7MemoryLocator CFragSystem7MemoryLocator;
  476.  
  477. struct CFragSystem7DiskFlatLocator {
  478.     FSSpecPtr                         fileSpec;
  479.     UInt32                             offset;
  480.     UInt32                             length;
  481. };
  482. typedef struct CFragSystem7DiskFlatLocator CFragSystem7DiskFlatLocator;
  483.  
  484. /* ! This must have a file specification at the same offset as a disk flat locator!*/
  485. struct CFragSystem7SegmentedLocator {
  486.     FSSpecPtr                         fileSpec;
  487.     OSType                             rsrcType;
  488.     SInt16                             rsrcID;
  489.     UInt16                             reservedA;                    /* ! Must be zero!*/
  490. };
  491. typedef struct CFragSystem7SegmentedLocator CFragSystem7SegmentedLocator;
  492.  
  493. struct CFragSystem7Locator {
  494.     SInt32                             where;
  495.     union {
  496.         CFragSystem7DiskFlatLocator     onDisk;
  497.         CFragSystem7MemoryLocator         inMem;
  498.         CFragSystem7SegmentedLocator     inSegs;
  499.     }                                 u;
  500. };
  501. typedef struct CFragSystem7Locator CFragSystem7Locator;
  502.  
  503. typedef CFragSystem7Locator *CFragSystem7LocatorPtr;
  504. struct CFragSystem7InitBlock {
  505.     CFragContextID                     contextID;
  506.     CFragClosureID                     closureID;
  507.     CFragConnectionID                 connectionID;
  508.     CFragSystem7Locator             fragLocator;
  509.     StringPtr                         libName;
  510.     UInt32                             reservedA;                    /* ! Must be zero!*/
  511. };
  512. typedef struct CFragSystem7InitBlock CFragSystem7InitBlock;
  513.  
  514. typedef CFragSystem7InitBlock *CFragSystem7InitBlockPtr;
  515. typedef CFragSystem7InitBlock CFragInitBlock;
  516. typedef CFragSystem7InitBlockPtr CFragInitBlockPtr;
  517. #endif
  518. typedef OSErr (*CFragInitFunction)(const CFragInitBlock *initBlock);
  519. typedef void (*CFragTermProcedure)(void );
  520. /*
  521.  §
  522.  ===========================================================================================
  523.  Old Name Spellings
  524.  ==================
  525.  -------------------------------------------------------------------------------------------
  526.  We've tried to reduce the risk of name collisions in the future by introducing the phrase
  527.  "CFrag" into constant and type names.  The old names are defined below in terms of the new.
  528. */
  529. #if OLDROUTINENAMES
  530. typedef CFragConnectionID ConnectionID;
  531. typedef CFragLoadOptions LoadFlags;
  532. typedef CFragSymbolClass SymClass;
  533. typedef CFragInitBlock InitBlock;
  534. typedef CFragInitBlockPtr InitBlockPtr;
  535. #if !FOR_OPAQUE_SYSTEM_DATA_STRUCTURES
  536. typedef CFragSystem7MemoryLocator MemFragment;
  537. typedef CFragSystem7DiskFlatLocator DiskFragment;
  538. typedef CFragSystem7SegmentedLocator SegmentedFragment;
  539. typedef CFragSystem7Locator FragmentLocator;
  540. typedef CFragSystem7LocatorPtr FragmentLocatorPtr;
  541. typedef CFragSystem7MemoryLocator CFragHFSMemoryLocator;
  542. typedef CFragSystem7DiskFlatLocator CFragHFSDiskFlatLocator;
  543. typedef CFragSystem7SegmentedLocator CFragHFSSegmentedLocator;
  544. typedef CFragSystem7Locator CFragHFSLocator;
  545. typedef CFragSystem7LocatorPtr CFragHFSLocatorPtr;
  546. #endif
  547.  
  548. enum {
  549.     kPowerPCArch                = kPowerPCCFragArch,
  550.     kMotorola68KArch            = kMotorola68KCFragArch,
  551.     kAnyArchType                = kAnyCFragArch,
  552.     kNoLibName                    = 0,
  553.     kNoConnectionID                = 0,
  554.     kLoadLib                    = kLoadCFrag,
  555.     kFindLib                    = kFindCFrag,
  556.     kNewCFragCopy                = kPrivateCFragCopy,
  557.     kLoadNewCopy                = kPrivateCFragCopy,
  558.     kUseInPlace                    = 0x80,
  559.     kCodeSym                    = kCodeCFragSymbol,
  560.     kDataSym                    = kDataCFragSymbol,
  561.     kTVectSym                    = kTVectorCFragSymbol,
  562.     kTOCSym                        = kTOCCFragSymbol,
  563.     kGlueSym                    = kGlueCFragSymbol,
  564.     kInMem                        = kMemoryCFragLocator,
  565.     kOnDiskFlat                    = kDataForkCFragLocator,
  566.     kOnDiskSegmented            = kResourceCFragLocator,
  567.     kIsLib                        = kImportLibraryCFrag,
  568.     kIsApp                        = kApplicationCFrag,
  569.     kIsDropIn                    = kDropInAdditionCFrag,
  570.     kFullLib                    = kIsCompleteCFrag,
  571.     kUpdateLib                    = kFirstCFragUpdate,
  572.     kWholeFork                    = kCFragGoesToEOF,
  573.     kCFMRsrcType                = kCFragResourceType,
  574.     kCFMRsrcID                    = kCFragResourceID,
  575.     kSHLBFileType                = kCFragLibraryFileType,
  576.     kUnresolvedSymbolAddress    = kUnresolvedCFragSymbolAddress
  577. };
  578.  
  579.  
  580. enum {
  581.     kPowerPC                    = kPowerPCCFragArch,
  582.     kMotorola68K                = kMotorola68KCFragArch
  583. };
  584.  
  585. #endif
  586.  
  587. #if PRAGMA_ALIGN_SUPPORTED
  588. #pragma options align=reset
  589. #endif
  590.  
  591. #if PRAGMA_IMPORT_SUPPORTED
  592. #pragma import off
  593. #endif
  594.  
  595. #ifdef __cplusplus
  596. }
  597. #endif
  598.  
  599. #endif /* __CODEFRAGMENTS__ */
  600.  
  601.